package com.zlx.store.common.results;

import com.zlx.store.common.constant.RespCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
@ApiModel("Api返回对象")

@Data
@AllArgsConstructor
@NoArgsConstructor
public class HttpResp<T> {
    private RespCode respCode;
    @ApiModelProperty(name = "results", notes = "后台返回结果对象")
    private T results;
    @ApiModelProperty(name = "time", notes = "返回的时间")
    private Date time;
    public static <T> HttpResp<T> httpResp(RespCode respCode, T results, Date time) {
        return new HttpResp<>(respCode, results, time);
    }
}
